<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html>
<html ng-app="app" id="ng-app">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<%@include file="/include/style.jsp"%>
<%@include file="/include/script.jsp"%>
<script type="text/javascript" src="/js/page/enum.js?v=<%=Constants.VERSION %>"></script>
<script type="text/javascript" src="/js/page/driver.js?v=<%=Constants.VERSION %>"></script>
<script type="text/javascript">
var QUERY_COOKIE = '${requestScope.cookie}';
</script>
</head>
<body ng-controller="DriverCtrl">
	<div class="toolbar">
		<div class="left-area">
			<form ng-submit="search()">
				<input type="text" id="name" ng-model="formCondition.name" placeholder="驱动名称或供应商模糊匹配" class="search-box">
				<select ng-change="search()" ng-model="formCondition.type" ng-options="option for option in DRIVER_TYPE" >
					<option value="">驱动类型</option>
				</select>
			</form>
		</div>
  		<div class="right-area">
  			<permission:valid permission="<%=Constants.DRIVER_CUD%>">
				<button class="btn btn-success" type="button" ng-click="createDriver()"><i class="fa fa-plus"></i> 新增 </button>
			</permission:valid>
  		</div>
	</div>
	
	<div ng-if="page.rows.length>0">
		<table class="data-table" style="table-layout:fixed;">
			<thead>
				<tr>
					<th width="5%">序号</th>
					<th width="10%" style="text-align: left;">驱动类型</th>
					<th width="20%" style="text-align: left;">供应商</th>
					<th width="35%" style="text-align: left;">驱动</th>
					<th width="15%">验证算法</th>
					<permission:valid permission="<%=Constants.DRIVER_CUD%>">
					<th width="15%">操作</th>
					</permission:valid>
				</tr>
			</thead>
		   <tbody>
			  <tr ng-repeat="driver in page.rows">
				  <td align="center">
				  	<span ng-bind="($index)+1"></span>
				  </td>
				  <td align="left" ng-bind="driver.type"></td>
				  <td align="left" ng-bind="driver.provider.name"></td>
				  <td align="left" ng-bind="driver.name"></td>
				  <td align="center" ng-bind="driver.algorithm"></td>
				  <permission:valid permission="<%=Constants.DRIVER_CUD%>">
				  <td align="center">
						<span class="btn btn-link" ng-click="editDriver(driver)"><i class="fa fa-pencil"></i> 修改</span>
						<span class="btn btn-link" ng-click="deleteDriver(driver)"><i class="fa fa-trash"></i> 删除</span>
				  </td>
				  </permission:valid>
			  </tr>
		   </tbody>
		</table>
		
		<%@include file="/include/pageBar.jsp" %>
	</div>
	
	<div class="alert alert-success" style="clear: both;" ng-if="page.rows.length==0">
		暂无数据！
	</div>
</body>
</html>